package cn.lanqiao.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.springframework.stereotype.Repository;

import cn.lanqiao.entity.Teacher;

/**
 * 教师信息
 * @author yejun
 */

@Repository
public interface TeacherMapper {

	//获取总用户数
	public int total();
	//分页
	public List<Teacher> teacherPages( Map<String,Object> map );
	//获取总记录数
	public int count( String  searchkey );
	//详情查看
	public Teacher getTeacher(Integer teacherId);
	//删除
	public int delete(Integer teacherId);
	//修改
	public int update(Teacher teacher);	
	//添加
	@Options(useGeneratedKeys = true,keyProperty = "teacherId")
    @Insert("insert into teacher(teacherName,sex,tel,email,pwd,cardId,role,type,institute) " +
            "values(#{teacherName},#{sex},#{tel},#{email},#{pwd},#{cardId},#{role},#{type},#{institute})")
	public  int add(Teacher teacher);
}
